package dev.tools.view.menus;

import dev.tools.view.dialogs.Dialog;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * Created with IntelliJ IDEA.
 * User: Nuno
 * Date: 01-10-2013
 * Time: 16:40
 */
public class DialogMenuItem extends JMenuItem implements ActionListener {
    private final Dialog dialog;

    public DialogMenuItem(Dialog dialog) {
        super(dialog.getTitle());
        this.dialog = dialog;
        addActionListener(this);
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        dialog.setVisible(true);
    }
}
